package Particles
{
	import Easing.Linear;
	
	import Tools.DisplayTool;
	
	import flash.display.Bitmap;
	
	public class SpurtParticle extends Particle
	{
		public var dx:Number = 0;
		public var dy:Number = 0;
		public var dRotation:Number = 0;
		public var friction:Number = 0;
		public var startScale:Number = 1;
		public var ax:Number = 0;
		public var ay:Number = 0;
		public var startAlpha:Number = 1;
		public var endScale:Number = 1;
		public var endAlpha:Number = 1;
		public function SpurtParticle()
		{
			super();
			obj=new Bitmap();
		}
		override protected function _update():void
		{
			dx = dx + ax;
			dy = dy + ay;
			if (friction > 0)
			{
				dx = dx * (1 - friction);
				dy = dy * (1 - friction);
			}
			x = x + dx;
			y = y + dy;
			var scale:Number = Linear.ease(ticks,startScale,endScale-startScale,duration);
			obj.scaleX=scale;
			obj.scaleY=scale;
			obj.alpha = Linear.ease(ticks,startAlpha,endAlpha-startAlpha,duration);
			obj.rotation+=dRotation;
			DisplayTool.moveTo(obj,x,y,handleX,handleY);
		}
	}
}